package com.csi.domain;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.sql.Date;

/**
 * 用户表
 */
@Data
@Schema(description = "用户信息模型")
public class User {

    @Schema(description = "用户的唯一标识符", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    private long id; // 用户id

    @Schema(description = "用户头像URL", example = "https://example.com/images/user_head_1.jpg")
    private String userHead; // 用户头像

    @Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "小明")
    private String userNickname; // 用户昵称

    @Schema(description = "用户真实姓名", requiredMode = Schema.RequiredMode.REQUIRED, example = "李华")
    private String username; // 用户姓名

    @Schema(description = "用户密码", requiredMode = Schema.RequiredMode.REQUIRED, example = "password123")
    private String password; // 用户密码

    @Schema(description = "用户性别（0：女，1：男）", requiredMode = Schema.RequiredMode.REQUIRED, example = "1", allowableValues = {"0", "1"})
    private int userSex; // 用户性别(0女1男)

    @Schema(description = "用户出生日期", requiredMode = Schema.RequiredMode.REQUIRED, type = "string", format = "date", example = "1990-01-01")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date userBirth; // 出生日期

    @Schema(description = "用户手机号", requiredMode = Schema.RequiredMode.REQUIRED, example = "13800001234")
    private String phone; // 手机号

    @Schema(description = "用户自我介绍", example = "热爱旅行和摄影...")
    private String userSelf; // 用户自我介绍


}